/*
  学习目标：声明状态, 获取状态
  语法: 
    声明状态:  state  = {数据变量名: 初始值}
    获取状态: this.state.数据变量名
*/

import React from 'react';

export default class App extends React.Component {
  // 1. 声明状态, 💥state必须是对象
  state = {
    count: 100,
    msg: 'hello 78',
  };

  render() {
    console.log('this  ----->  ', this);
    return (
      <h1>
        hello App - {this.state.count}
        {/* 2.获取状态: this.state.数据变量名 */}
        {this.state.msg}
      </h1>
    );
  }
}
